Use the slice allocator for regions. Still todo: avoid extra allocations
authorMatthias Clasen <mclasen@redhat.com>
Wed, 21 Dec 2005 21:10:41 +0000 (21:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 21 Dec 2005 21:10:41 +0000 (21:10 +0000)
2005-12-21  Matthias Clasen  <mclasen@redhat.com>

* gdk/gdkregion-generic.c: Use the slice allocator
for regions. Still todo: avoid extra allocations for
the single-rectangle case.

ChangeLog
ChangeLog.pre-2-10
gdk/gdkregion-generic.c

index 3b8879bfd3562824da8849fd45cd2162c5a2576c..55dc375a9848afdd0cadd827d48673122341b1f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-12-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkregion-generic.c: Use the slice allocator
+       for regions. Still todo: avoid extra allocations for
+       the single-rectangle case.
+
        * gtk/gtksettings.c (gtk_settings_class_init): Update
        class_n_properties after installing color-hash, since
        other classes install settings, too.
index 3b8879bfd3562824da8849fd45cd2162c5a2576c..55dc375a9848afdd0cadd827d48673122341b1f5 100644 (file)
@@ -1,5 +1,9 @@
 2005-12-21  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/gdkregion-generic.c: Use the slice allocator
+       for regions. Still todo: avoid extra allocations for
+       the single-rectangle case.
+
        * gtk/gtksettings.c (gtk_settings_class_init): Update
        class_n_properties after installing color-hash, since
        other classes install settings, too.
index 1dbdc32fb97e591d78789067eb0e2103a011bb85..a7bbeb0a6c6bbb2c18ba5ef733e14eb164f665ba 100644 (file)
@@ -112,7 +112,7 @@ gdk_region_new ()
 {
   GdkRegion *temp;
 
-  temp = g_new (GdkRegion, 1);
+  temp = g_slice_new (GdkRegion);
   temp->rects = g_new (GdkRegionBox, 1);
 
   temp->numRects = 0;
@@ -143,7 +143,7 @@ gdk_region_rectangle (GdkRectangle *rectangle)
   if (rectangle->width <= 0 || rectangle->height <= 0)
     return gdk_region_new();
 
-  temp = g_new (GdkRegion, 1);
+  temp = g_slice_new (GdkRegion);
   temp->rects = g_new (GdkRegionBox, 1);
 
   temp->numRects = 1;
@@ -171,7 +171,7 @@ gdk_region_copy (GdkRegion *region)
 
   g_return_val_if_fail (region != NULL, NULL);
 
-  temp = g_new (GdkRegion, 1);
+  temp = g_slice_new (GdkRegion);
   temp->rects = g_new (GdkRegionBox, region->numRects);
 
   temp->numRects = region->numRects;
@@ -330,7 +330,7 @@ gdk_region_destroy (GdkRegion *r)
   g_return_if_fail (r != NULL);
   
   g_free (r->rects);
-  g_free (r);
+  g_slice_free (GdkRegion, r);
 }